export function isEmpty(obj) {
    if (obj == null || obj == "" || obj == undefined) {
        return true;
    }
    return false;
}


export function getImg(src) {
    let baseUrl = process.env.VUE_APP_BASE_API;
    if(src == null || src == ""){
        return "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif";
    }else{
        return baseUrl + "/api/member/upload/download/" + src;
    }
}

export function getBase64(file) {  //把图片转成base64编码
    return new Promise(function (resolve, reject) {
        let reader = new FileReader();
        let imgResult = "";
        reader.readAsDataURL(file);
        reader.onload = function () {
            imgResult = reader.result;
        };
        reader.onerror = function (error) {
            reject(error);
        };
        reader.onloadend = function () {
            resolve(imgResult);
        }
    });
};